﻿#include "UBasePanel.h"


UBasePanel::UBasePanel(QWidget * parent)
{
	m_pTimer = nullptr;
	m_pBeltData = nullptr;
	m_pBeltCtrMgr = nullptr;
	m_bRefush = false;
}
UBasePanel::~UBasePanel()
{

}


void UBasePanel::init()
{
	/*m_pTimer = new QTimer(this);
	m_pTimer->setTimerType(Qt::TimerType::PreciseTimer);*/
}

void UBasePanel::initPanel(CBeltDataBase *pBeltData,CBeltCtrMgr *pBeltCtrMgr)
{
	m_pBeltData = pBeltData;
	m_pBeltCtrMgr = pBeltCtrMgr;
	init();
}



void UBasePanel::refreshData(bool bRefresh)
{
	if (m_pTimer == nullptr)
		return;
	if (bRefresh)
	{
		if (!m_pTimer->isActive())
		{
			m_bRefush = true;
			m_pTimer->start(1000);
			
		}
	}
	else
	{
		if (m_pTimer->isActive())
		{
			m_bRefush = true;
			m_pTimer->stop();
		}
	}
}